use "perla_brazil.dta"
rename p2 age
rename p3 sex
rename p4 race
rename p5 colour
rename p135 education
rename p137 father_education
rename p138 mother_education
generate female = sex==2
generate native = race==1
generate black = race==2|race==7
generate mixed = race==3|race==5|race==8
generate white = race==4
generate other = race==6
generate asian = race==9 
generate colour_bin = 1 if colour==1|colour==2|colour==3|colour==4
replace colour_bin = 2 if colour==5|colour==6|colour==7
replace colour_bin = 3 if colour==8|colour==9|colour==10|colour==11
*Results for Appendix Table D.3
reg education colour_bin female age black mixed native asian other father_education mother_education, r